using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Coins : MonoBehaviour
{
    public GameObject particlePrefab;
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            // other.GetComponentInChildren<PlayerCharacter>().AddCoin();
            other.GetComponent<PlayerCharacter>().AddCoin(1);
            Instantiate(particlePrefab, transform.position, Quaternion.identity);
            Destroy(gameObject);
        }
    }
}
